package com.ice.client.starter;


import com.alibaba.cloud.nacos.discovery.NacosServiceDiscovery;
import com.ice.core.client.ha.IceServerHaNacosDiscovery;
import org.springframework.boot.autoconfigure.condition.ConditionalOnBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;

/**
 * @author waitmoon
 */
@Configuration
@ComponentScan("com.ice.client")
public class IceClientAutoConfiguration {

    @Bean
    @ConditionalOnBean(NacosServiceDiscovery.class)
    public IceServerHaNacosDiscovery iceServerHaNacosDiscovery(NacosServiceDiscovery nacosServiceDiscovery) {
        return new IceServerHaNacosDiscovery(nacosServiceDiscovery);
    }
}
